from rest_framework import serializers
from rest_framework.viewsets import ModelViewSet
from aaa import models

class rightsSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Permission
        fields = ['id','authName','url','level']

class rightsView(ModelViewSet):
    queryset = models.Permission.objects.all()
    serializer_class = rightsSerializer